// api/family.ts
import apiClient from './index';

export interface CreateFamilyData {
  name: string;
}

export interface JoinFamilyData {
  code: string;
}

export const createFamily = (familyData: CreateFamilyData) => {
  return apiClient.post('/family/create', familyData);
};

export const generateInviteCode = () => {
  return apiClient.post('/family/generate_invite');
};

export const joinFamily = (inviteCode: JoinFamilyData) => {
  return apiClient.post('/family/join', inviteCode);
};

export const getFamilyMembers = () => {
  return apiClient.get('/family/members');
};

// export const leaveFamily = () => {
//   return apiClient.delete('/family/leave');
// };